/** layuiAdmin.pro-v1.2.1 LPPL License By http://www.layui.com/admin/ */
;
layui.define(["table", "form"],
function(e) {
    var $ = layui.$,
    i = (layui.$, layui.admin),
    t = layui.view,
    l = layui.table,
    r = layui.form;
    l.render({
        elem: "#LAY-cash-manage",
        url: layui.setter.baseUrl+"cash/index",
        cols: [[{
            field: "id",
            width: 100,
            title: "编号ID",
            sort: !0
        },
        {
            field: "nickname",
            title: "用户",
            minWidth: 100,
            templet: "#imgTpl"
        },
        {
            field: "mobile",
            title: "手机号"
        },
        {
            field: "price",
            title: "金额",
            templet: "<span>￥{{d.price}}</span>"
        },
        {
            field: "num",
            title: "次数"
        },
        {
            field: "createtime",
            title: "提现时间",
            templet: "#timeTpl"
        },
        {
            field: "type",
            title: "提现类型",
            templet: '#typeTpl'
        },
        {
            field: "status",
            title: "状态",
            templet: '#statusTpl'
        },
        {
            field: "info",
            title: "提现信息",
            templet: '#infoTpl'
        },
        {
            title: "操作",
            width: 130,
            align: "center",
            fixed: "right",
            toolbar: "#table-cash-oper"
        }]],
        page: !0,
        limit: 10,
        text: {
            none: '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
        }
    }),
    l.on("tool(LAY-cash-manage)",
    function(e) {
        var l = e.data;
        if("tg" === e.event){
            layer.confirm("确定通过吗？",function(i) {
                $.post(
                    layui.setter.baseUrl+'cash/tg',
                    {id: l.id},
                    function(ret){
                        var {code,msg,data} = ret;
                        layer.alert(msg);
                        if(code==0){
                            layui.table.reload('LAY-cash-manage');
                        }
                    }
                );
            })
        }
        if("jj" === e.event){
            layer.confirm("确定拒绝吗？",function(i) {
                $.post(
                    layui.setter.baseUrl+'cash/jj',
                    {id: l.id},
                    function(ret){
                        var {code,msg,data} = ret;
                        layer.alert(msg);
                        if(code==0){
                            layui.table.reload('LAY-cash-manage');
                        }
                    }
                );
            })
        }
    }),
    e("cash", {})
});